<template>
	<view>
		<uni-nav-bar background-color="#e32519" color="#fff" status-bar="true" :fixed="true" @clickLeft="clickNavLeft()"
			@clickRight="clickNavRight()">
			
			<view slot="left">
				返回
				<!-- <u-icon color="white" size="22" name="arrow-left"></u-icon> -->
			</view>

			<view slot="right">
				<!-- <u-icon color="white" size="22" name="share-square"></u-icon> -->
			</view>
		</uni-nav-bar>
		
		<view style="width: 400px; z-index: 100;" v-for="item in shuju">
			
			<!-- 自定义组件card -->
			<card style="z-index:100;margin-top: 10px;" :src="item.img_url"></card>
			
		<view style="margin: 10px 5%;width: 90%;line-height: 60px;text-indent:60px;">
				<text>{{item.detail}}</text>
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				shuju: "",
				newsid: 1
			}
		},

		methods: {
			async requestNewsDetail() {
				uni.request({
					method: 'post',
					data: {
						id: this.newsid
					},
					url: 'http://127.0.0.1:3000/news_detail',
					success: res => {
						this.shuju = res.data,
							console.log(res.data)
					}
				})
			},

			clickNavLeft() {
				uni.navigateTo({
					url: "../bl/bl"
				})
			},
			load(e){
				this.newsid = e
				this.requestNewsDetail()
			}
		},
		onLoad(options) {
			
			console.log(options.id),
			this.load(options.id)
			// this.active = option.id
			// this.requestNewsDetail()
			
				



		}
	}
</script>


<style>
	page {
		background-color: #ffffff;
	}
</style>
